package cn.sf.sufingadminconsumer.service;

import cn.sf.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "sufing-admin-provider")
public interface UserManagerService {

  @RequestMapping("/selectAllUserInfo")
  public List<User> selectAllUserInfo();

  /*
   *依据用户id查询
   */
  @RequestMapping("/selectById")
  public List<User> selectById(@RequestParam("userId") long userId);

  /*
   *依据用户名查询
   */
  @RequestMapping("/selectByUserName")
  public List<User> selectByUserName(@RequestParam("userName") String userName);

  /*
   *依据邮箱地址查询
   */
  @RequestMapping("/selectByEmail")
  public List<User> selectByEmail(@RequestParam("userEmail") String userEmail);

  /*
   *依据用户联系方式查询
   */
  @RequestMapping("/selectByPhone")
  public List<User> selectByPhone(@RequestParam("userPhone") long userPhone);

  /*
   *依据用户性别查询
   */
  @RequestMapping("/selectBySex")
  public List<User> selectBySex(@RequestParam("userSex") String userSex);

  /*
   *依据用户信息添加查询
   */
  @RequestMapping("/insertUserInfo")
  public int insertUserInfo(@RequestBody User User);

  /*
   *依据用户信息修改查询
   */
  @RequestMapping("/UpdateUserInfo")
  public int UpdateUserInfo(@RequestBody User user);

  /*
   *删除用户信息
   */
  @RequestMapping("/deleteById")
  public int deleteById(@RequestParam("userId") long userId);
}
